#ifndef _screen_h
#define _screen_h

#include "rgb.h"


/** \brief Drawing and updating. */
namespace screen
{
  /** \brief Text align definitions */
  enum
  {
    HA_LEFT=0x00, ///< left align (default)
    HA_RIGHT=0x01, ///< right align
    HA_CENTER=0x02, ///< horizontally centered
    VA_TOP=0x04, ///< top align (default)
    VA_BOTTOM=0x08, ///< bottom align
    VA_MIDDLE=0x10 ///< vertically centered
  };

  /** \brief Create main window.
    *
    * Is automatically called by core::init()!
    */
  int init();

  /** \brief Call this function to update window. */
  void update();


  /** \brief Draw a sprite on the screen.
    *
    * \note The origin of a sprite is in the upper left corner of it
    * (and not at the center). Means: a sprite drawn at (0,0) is fully
    * visible, whereas drawn at (SCREEN_WIDTH,SCREEN_HEIGHT) is hidden.
    *
    * \param name Name of sprite (without directory file extension)
    * \param x Horizontal coordinate, starting from the left
    * \param y Vertical coordinate, starting from the top
    */
  void drawSprite(const char *name, int x=0, int y=0);

  /** \brief Draw some text on the screen.
    *
    * \note Only few characters seem to work (for example no commas).
    * New line (\\n) either unsupported by font or by add-on.
    *
    * \param text Text string to display (null-terminated)
    * \param x Horizontal coordinate, starting from the left
    * \param y Vertical coordinate, starting from the top
    */
  void drawText(const char *text, int x=0, int y=0);

  /** \brief Set color for text.
    *
    * This function affects all text drawings after
    * this call.
    */
  void setTextColor(rgb_t color);

  /** \brief Set text align. */
  void setTextAlign(u8 align);
}

#endif // #ifndef _screen_h
